package com.cn.web.controller.EM.partRegt;

import com.alibaba.fastjson2.JSONObject;
import com.cn.bean.vo.EM.partRegt.BarkPar;
import com.cn.mapper.dao.db5.EM.partRegt.PartSingleAlterInfoDao;
import com.cn.mapper.dao.db5.EM.partRegt.PartSingleInfoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Transactional
@RequestMapping("/PartSingleAlterInfo")
public class PartSingleAlterInfoController {
    private final PartSingleAlterInfoDao partSingleAlterInfoDao;

    @Autowired(required = false)
    public PartSingleAlterInfoController(PartSingleAlterInfoDao partSingleAlterInfoDao) {
        this.partSingleAlterInfoDao = partSingleAlterInfoDao;
    }


    @RequestMapping("/insert")
    @ResponseBody
    public BarkPar insert(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);


        return partSingleAlterInfoDao.insert(String.valueOf(jsonObject));

    }

    @RequestMapping("/getSing")
    @ResponseBody
    public String getSing(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        String sing = partSingleAlterInfoDao.getSing(String.valueOf(jsonObject));
        System.out.println("aaaaaaaaaccccccc"+sing);
        return sing;
    }

    @RequestMapping("/getList")
    @ResponseBody
    public String getList(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        String list = partSingleAlterInfoDao.getList(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/getRack")
    @ResponseBody
    public String getRack(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:eeeeeeee" + jsonObject);
        String list = partSingleAlterInfoDao.getRack(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxaaxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/getInfo")
    @ResponseBody
    public String getInfo(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = partSingleAlterInfoDao.getInfo(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/stateUp")
    @ResponseBody
    public BarkPar stateUp(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        return partSingleAlterInfoDao.stateUp(String.valueOf(jsonObject));
    }
    @RequestMapping("/supplier")
    @ResponseBody
    public String supplier(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = partSingleAlterInfoDao.supplier(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }
    @RequestMapping("/getModel")
    @ResponseBody
    public String getEquipment(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = partSingleAlterInfoDao.getModel(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }
    @RequestMapping("/getEquipmentList")
    @ResponseBody
    public String getEquipmentList(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = partSingleAlterInfoDao.getEquipmentList(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }
    @RequestMapping("/getSystemStateCode")
    @ResponseBody
    public String getSystemStateCode(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = partSingleAlterInfoDao.getSystemStateCode(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }
}
